import 'package:wanxiang_app/generated/json/base/json_convert_content.dart';
import 'package:wanxiang_app/bean/order_detail_entity.dart';

OrderDetailEntity $OrderDetailEntityFromJson(Map<String, dynamic> json) {
  final OrderDetailEntity orderDetailEntity = OrderDetailEntity();
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    orderDetailEntity.code = code;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    orderDetailEntity.msg = msg;
  }
  final OrderDetailData? data = jsonConvert.convert<OrderDetailData>(
      json['data']);
  if (data != null) {
    orderDetailEntity.data = data;
  }
  return orderDetailEntity;
}

Map<String, dynamic> $OrderDetailEntityToJson(OrderDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = entity.code;
  data['msg'] = entity.msg;
  data['data'] = entity.data.toJson();
  return data;
}

extension OrderDetailEntityExtension on OrderDetailEntity {
  OrderDetailEntity copyWith({
    int? code,
    String? msg,
    OrderDetailData? data,
  }) {
    return OrderDetailEntity()
      ..code = code ?? this.code
      ..msg = msg ?? this.msg
      ..data = data ?? this.data;
  }
}

OrderDetailData $OrderDetailDataFromJson(Map<String, dynamic> json) {
  final OrderDetailData orderDetailData = OrderDetailData();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    orderDetailData.id = id;
  }
  final int? channelId = jsonConvert.convert<int>(json['channel_id']);
  if (channelId != null) {
    orderDetailData.channelId = channelId;
  }
  final String? sellUserid = jsonConvert.convert<String>(json['sell_userid']);
  if (sellUserid != null) {
    orderDetailData.sellUserid = sellUserid;
  }

  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    orderDetailData.title = title;
  }
  final String? sellPrice = jsonConvert.convert<String>(json['sell_price']);
  if (sellPrice != null) {
    orderDetailData.sellPrice = sellPrice;
  }
  final String? traTime = jsonConvert.convert<String>(json['tra_time']);
  if (traTime != null) {
    orderDetailData.traTime = traTime;
  }
  final String? updateTime = jsonConvert.convert<String>(json['update_time']);
  if (updateTime != null) {
    orderDetailData.updateTime = updateTime;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    orderDetailData.status = status;
  }
  final String? guid = jsonConvert.convert<String>(json['guid']);
  if (guid != null) {
    orderDetailData.guid = guid;
  }
  final int? isIndulge = jsonConvert.convert<int>(json['is_indulge']);
  if (isIndulge != null) {
    orderDetailData.isIndulge = isIndulge;
  }
  final int? isMsg = jsonConvert.convert<int>(json['is_msg']);
  if (isMsg != null) {
    orderDetailData.isMsg = isMsg;
  }
  final String? isBystages = jsonConvert.convert<String>(json['is_bystages']);
  if (isBystages != null) {
    orderDetailData.isBystages = isBystages;
  }
  final String? categoryText = jsonConvert.convert<String>(
      json['category_text']);
  if (categoryText != null) {
    orderDetailData.categoryText = categoryText;
  }
  final String? sxPrice = jsonConvert.convert<String>(json['sx_price']);
  if (sxPrice != null) {
    orderDetailData.sxPrice = sxPrice;
  }
  final String? imgUrl = jsonConvert.convert<String>(json['img_url']);
  if (imgUrl != null) {
    orderDetailData.imgUrl = imgUrl;
  }
  final String? gamePassword = jsonConvert.convert<String>(
      json['game_password']);
  if (gamePassword != null) {
    orderDetailData.gamePassword = gamePassword;
  }
  final String? realityPrice = jsonConvert.convert<String>(
      json['reality_price']);
  if (realityPrice != null) {
    orderDetailData.realityPrice = realityPrice;
  }
  final String? paycode = jsonConvert.convert<String>(json['paycode']);
  if (paycode != null) {
    orderDetailData.paycode = paycode;
  }
  final String? gameAccount = jsonConvert.convert<String>(json['game_account']);
  if (gameAccount != null) {
    orderDetailData.gameAccount = gameAccount;
  }
  return orderDetailData;
}

Map<String, dynamic> $OrderDetailDataToJson(OrderDetailData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['channel_id'] = entity.channelId;
  data['sell_userid'] = entity.sellUserid;
  data['title'] = entity.title;
  data['sell_price'] = entity.sellPrice;
  data['tra_time'] = entity.traTime;
  data['update_time'] = entity.updateTime;
  data['status'] = entity.status;
  data['guid'] = entity.guid;
  data['is_indulge'] = entity.isIndulge;
  data['is_msg'] = entity.isMsg;
  data['is_bystages'] = entity.isBystages;
  data['category_text'] = entity.categoryText;
  data['sx_price'] = entity.sxPrice;
  data['img_url'] = entity.imgUrl;
  data['game_password'] = entity.gamePassword;
  data['reality_price'] = entity.realityPrice;
  data['paycode'] = entity.paycode;
  data['game_account'] = entity.gameAccount;
  return data;
}

extension OrderDetailDataExtension on OrderDetailData {
  OrderDetailData copyWith({
    int? id,
    int? channelId,
    String? title,
    String? sellUserid,
    String? sellPrice,
    String? traTime,
    String? updateTime,
    int? status,
    String? guid,
    int? isIndulge,
    int? isMsg,
    String? isBystages,
    String? categoryText,
    String? sxPrice,
    String? imgUrl,
    String? gamePassword,
    String? realityPrice,
    String? paycode,
    String? gameAccount,
  }) {
    return OrderDetailData()
      ..id = id ?? this.id
      ..channelId = channelId ?? this.channelId
      ..sellUserid = sellUserid ?? this.sellUserid
      ..title = title ?? this.title
      ..sellPrice = sellPrice ?? this.sellPrice
      ..traTime = traTime ?? this.traTime
      ..updateTime = updateTime ?? this.updateTime
      ..status = status ?? this.status
      ..guid = guid ?? this.guid
      ..isIndulge = isIndulge ?? this.isIndulge
      ..isMsg = isMsg ?? this.isMsg
      ..isBystages = isBystages ?? this.isBystages
      ..categoryText = categoryText ?? this.categoryText
      ..sxPrice = sxPrice ?? this.sxPrice
      ..imgUrl = imgUrl ?? this.imgUrl
      ..gamePassword = gamePassword ?? this.gamePassword
      ..realityPrice = realityPrice ?? this.realityPrice
      ..paycode = paycode ?? this.paycode
      ..gameAccount = gameAccount ?? this.gameAccount;
  }
}